package cn.i7baozh.cloud.payment.service.impl;

import cn.i7baozh.cloud.payment.entities.Pay;
import cn.i7baozh.cloud.payment.mapper.PayMapper;
import cn.i7baozh.cloud.payment.service.PayService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author : zlmismeno1
 * @date :   2024/12/25 11:35
 */
@Service
@Slf4j
public class PayServiceImpl implements PayService {

    @Resource
    private PayMapper payMapper;

    @Override
    public int addPay(Pay pay) {
        return payMapper.insertSelective(pay);
    }

    @Override
    public int updatePay(Pay pay) {
        return payMapper.updateByPrimaryKeySelective(pay);
    }

    @Override
    public Pay selectById(Integer id) {
        return payMapper.selectByPrimaryKey(id);
    }

    @Override
    public int delete(Integer id) {
        return payMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<Pay> selectAll() {
        return payMapper.selectAll();
    }
}
